.\" Copyright (c) 2010, Benjamin Drung <bdrung@debian.org>
.\"
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.TH WRAP\-AND\-SORT 1 "Debian Utilities" "DEBIAN"
.SH NAME
wrap-and-sort \- wrap long lines and sort items in Debian packaging files
.SH SYNOPSIS
.B wrap-and-sort
[\fIoptions\fR]

.SH DESCRIPTION
\fBwrap\-and\-sort\fP wraps the package lists in Debian control files. By
default the lists will only split into multiple lines if the entries are longer
than the maximum line length limit of 79 characters. \fBwrap\-and\-sort\fP sorts
the package lists in Debian control files and all \fI.dirs\fR, \fI.docs\fR,
\fI.examples\fR, \fI.info\fR, \fI.install\fR, \fI.links\fR, \fI.maintscript\fR,
and \fI.manpages\fR files. Beside that \fBwrap\-and\-sort\fP removes trailing
spaces in these files.
.PP
This script should be run in the root of a Debian package tree. It searches for
\fIcontrol\fR, \fIcontrol*.in\fR, \fIcopyright\fR, \fIcopyright.in\fR,
\fIinstall\fR, and \fI*.install\fR in the \fIdebian\fR directory.

.SH OPTIONS
.TP
\fB\-h\fR, \fB\-\-help\fR
Show this help message and exit. Will also print the default values for
the options below.
.TP
\fB\-a\fR, \fB\-\-[no\-]wrap\-always\fR
Wrap all package lists in the Debian \fIcontrol\fR file
even if they do not exceed the line length limit and could fit in one line.
.TP
\fB\-s\fR, \fB\-\-[no\-]short\-indent\fR
Indent wrapped lines by a single space, instead of in\-line with the
field name.
.TP
\fB\-b\fR, \fB\-\-[no\-]sort\-binary\-packages\fR
Sort binary package paragraphs by name.
.TP
\fB\-k\fR, \fB\-\-[no-]keep\-first\fR
When sorting binary package paragraphs, leave the first one at the top.

Unqualified
.BR debhelper (7)
configuration files are applied to the first package.
.TP
\fB\-n\fR, \fB\-\-[no\-]cleanup\fR
Remove trailing whitespaces.
.TP
\fB\-t\fR, \fB\-\-[no\-]trailing\-comma\fR
Add a trailing comma at the end of the sorted fields.
This minimizes future differences in the VCS commits when additional
dependencies are appended or removed.
.TP
\fB\-d \fIpath\fR, \fB\-\-debian\-directory=\fIpath\fR
Location of the \fIdebian\fR directory (default: \fI./debian\fR).
.TP
\fB\-f \fIfile\fR, \fB\-\-file=\fIfile\fR
Wrap and sort only the specified \fIfile\fR.
You can specify this parameter multiple times.
All supported files will be processed if no files are specified.
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Print all files that are touched.
.TP
\fB\-\-max\-line\-length=\fImax_line_length\fR
Set the maximum allowed line length. Package lists in the Debian \fIcontrol\fR
file that exceed this length limit will be wrapped.

The default maximum line length is 79 characters.
.TP
\fB\-N\fR, \fB\-\-dry\-run\fR
Do not modify any file, instead only print the files that would be modified.

.TP
\fB\-\-experimental\-rts\-parser\fR
Temporary option accepted for compatibility with an experiment. It no longer
does anything. Please remove any use of it.

.SH AUTHORS
\fBwrap\-and\-sort\fP and this manpage have been written by
Benjamin Drung <bdrung@debian.org>.
.PP
Both are released under the ISC license.
